

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

/**
 * Servlet implementation class for Servlet: CookieServlet
 *
 */
 public class CookieServlet extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet {

	public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		String uname=request.getParameter("username");
		String pword=request.getParameter("password");
		Cookie c[]=new Cookie[3];
		c[0]=new Cookie("username", uname);
		c[1]=new Cookie("password", pword);
		//c[1].setPath("C:\\Documents and Settings\\student\\Desktop");
		//c[2].setPath("C:\\Documents and Settings\\student\\Desktop");
		response.addCookie(c[0]);
		response.addCookie(c[1]);	
		
		response.sendRedirect("http://localhost:8080/TestProject/Show");
	}
}